/**
 * OSAmI: Open Source Ambient Intelligence
 * Copyright (C) 2010 Bull S.A.S.
 * Contact: osami-general@osami-commons.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 */

package org.osami.gateway.identity;

import org.osgi.framework.Filter;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: guillaume
 * Date: 28 juil. 2010
 * Time: 17:53:08
 * To change this template use File | Settings | File Templates.
 */
public interface IdentityManager extends IdentityProvider, IdentityBinder {

    /**
     * Creates a new Identity
     * @return the newly created Identity.
     */
    Identity createIdentity();

    /**
     * Creates a new Identity (child of the given parent Identity).
     * The child Identity's properties inherit from the properties of the parent (parent overwrite).
     * @param parent parent Identity (may be null)
     * @return the newly created Identity.
     */
    Identity createIdentity(Identity parent);

    /**
     * Delete a given Identity
     * @param id Identity unique ID
     */
    void removeIdentity(String id);

    Collection<Identity> getIdentities(Filter filter);

    /**
     * Returns an Identity with the given ID (this is not a bound
     * identifier, this is the ID of the Identity).
     * @param identityId Identity ID
     * @return the Identity with the given ID
     */
    Identity getIdentity(String identityId);
}
